import { Controller, Post, UseGuards, Body, Get } from '@nestjs/common';
import { AuthService } from './auth/auth.service';
import { LocalAuthGuard } from './auth/local-auth.guard';
import { Public } from './auth/public';

@Controller()
export class AppController {
  constructor(private readonly authService: AuthService) {}

  @Public()
  @UseGuards(LocalAuthGuard)
  @Post('/login')
  async login(@Body() req) {
    return this.authService.login(req);
  }

  @Get('profile')
  getProfile() {
    return {
      code: 200,
      message: '测试成功',
    };
  }
}
